using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Reflection;
using System.IO;
using ImageManipulation;
using System.Drawing.Imaging;

namespace Tester
{
    class Program
    {
        static void Main(string[] args)
        {
            Assembly assem = Assembly.GetExecutingAssembly();

            
            using (Stream s = assem.GetManifestResourceStream(
                assem.GetName().Name.ToString() + ".Flower.gif"))
            {
                Bitmap srcBmp = Bitmap.FromStream(s) as Bitmap;
                
                Quantizer q1 = new OctreeQuantizer(128, 7);
                q1.Quantize(srcBmp).Save("octree.png", ImageFormat.Png);

                Bitmap result = null;
                //for (int i = 0; i < 1000; i++)
                //{
                    
                    Quantizer q2 = new MedianCutQuantizer(128);
                    //Quantizer q2 = new OctreeQuantizer(255, 8);
                    result = q2.Quantize(srcBmp);
                    
                //}

                result.Save("median.png", ImageFormat.Png);
            }
        }
    }
}
